package com.jweb.framework.core;

import java.util.Locale;
import java.util.Map;

import com.jweb.framework.core.channel.ChannelContext;


public interface Context {
	
	public static final String ATTR_PRIORITY = "PRIORITY";
	public static final String ATTR_CORRELATION_ID = "CORRELATION_ID";
	public static final String ATTR_PARAMETERS = "PARAMETERS";
	public static final String ATTR_CHANNEL = "channel";
	public static final String ATTR_CAPTCHA = "CAPTCHA";
	public static final String ATTR_SOURCE = "x-source";
	public static final String ATTR_TOKEN = "x-token";
	public static final String ATTR_PRINCIPAL = "x-principal";
	public static final String ATTR_CERT = "x-certification";
	
	public String getRequestId();
	
	public String getSessionId();
	
	public String getProcessId();
	
	public Processing getProcess();
	
	public long getTimestamp();
	
	public Locale getLocale() ;
	
	public String getState();
	
	public CoreException getException();
	
	public <T> T getData(String str);
	
	public  Map<String,Object> getDataMap();
	
	public  Map<String,Object> getDataMapDirectly();
	
	public  <T> T getVariable(String param);
	
	public  Map<String,Object> getVariables();
	
	public  <T> T getAttribute(String param);
	
	public  Map<String,Object> getAttributes();
	
	public  <T> T getSessionAttribute(String param);
	
	public  Map<String,Object> getSessionAttributes();
	
	public  <S> S getService(Class<S> clazz);
	
	public  <S> S getService(String param) ;
	
	public void setRequestId(String requestId) ;
	
	public  void setProcessId(String param);
	
	public  void setProcess(Processing processing);
	
	public  void setLocale(Locale locale);
	
	public  void setVariable(String param, Object obj);
	
	public  void setVariables(Map<String,Object> map);
	
	public  void setData(String param, Object obj);
	
	public  void setDataMap(Map<String, Object> paramMap);
	
	public  void setException(CoreException exception);
	
	public  void setState(String param);
	
	public void setUser(User user);
	
	public <T extends User> T getUser();
	
	public void clearContext() ;
	
	public void setMsgType(String msgType) ;
	
	public void setRspCode(String rspCode) ;
	
	public void setRspMsg(String rspMsg) ;
	
	public String getMsgType() ;
	
	public String getRspCode() ;
	
	public String getRspMsg() ;
	
	public ChannelContext getChannelContext() ;
	
	public void setChannelContext(ChannelContext channelContext);
	
	public Object removeData(String key) ;

}
